<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>列表渲染</title>
</head>
<body>
<div id="div">
    <!--需求1：循环展示vue中定义的数组的内容-->
    <ul>
        <li v-for="value in names" v-html="value"></li>
    </ul>

    <hr>
    <!--需求2：循环展示vue中定义的对象的内容-->
    <ul>
        <!--<li v-for="value in user">{{value}}</li>-->
        <li v-for="(value,key) in user">{{key}}={{value}}</li>
    </ul>
</div>
</body>
<script src="js/vue.js"></script>
<script>
    new Vue({
        el: "#div",
        data:{
            names:["左十二","张靓颖","吴贱贱"],
            user:{
                name:"左十二",
                age:22,
                job:"职业选手"
            }
        }
    });
</script>
</html>